﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security;

namespace QianBuo.SchemeTool.Forms
{
    public partial class RegistForm : Form
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key">序列号</param>
        /// <param name="pwd">正确的激活码</param>
        public RegistForm(string key, string pwd)
        {
            InitializeComponent();
            this.DialogResult = DialogResult.Cancel;
            this.txtRegCode.Text = key;
            PwdCode = pwd;
        }

        private string PwdCode;

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (PwdCode.Equals(txtRegKey.Text, StringComparison.CurrentCultureIgnoreCase))
            {
                this.DialogResult = DialogResult.OK;
                MessageBox.Show("感谢您的使用！");
            }
            else
            {
                MessageBox.Show("请输入正确的密钥");
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
